<template>
  <el-dialog v-model="visiable" title="选择出库单" @close="close">
    <MkTable :data="chuKuDanList" @row-dblclick="chooseRow">
      <MkColumnIndex />
      <MkColumn prop="danHao" label="出库单号" />
      <MkColumn prop="faXueLeiXing" label="发血类型" />
      <MkColumn prop="chuKuShiJian" label="出库时间" />
      <MkColumn prop="remark" label="备注" />
    </MkTable>
  </el-dialog>
</template>

<script lang='ts' setup>
import { XieYiYiYuanChuKuApi, XieYiYiYuanChuKuOutput } from '/@/api/inv/invXieYiYiYuanChuKu';
import { loginInfo } from '/@/stores/baseInfo';
const visiable = ref(false);
const chuKuDanList = ref<XieYiYiYuanChuKuOutput[]>([]);
const config = ref({
  confirmCallback: (item: any) => { },
  destory: () => { }
})
const open = () => {
  visiable.value = true;
  XieYiYiYuanChuKuApi.xieYiYiYuanChuKuList({ danJuZhuangTai: 3, ruKuYuanQuId: loginInfo.value.yuanQuId }).then((res: any) => {
    chuKuDanList.value = res;
  })
}
const chooseRow = (row: XieYiYiYuanChuKuOutput) => {
  console.log('选择的行', row);
  config.value.confirmCallback(row);
  config.value.destory()
  visiable.value = false;
}
const close = () => {
  config.value.destory()
  visiable.value = false;
}
defineExpose({ config, open })
</script>

<style lang='scss' scoped></style>